package com.xyzwps.paimon.furina.modules.post

import com.xyzwps.paimon.furina.common.value.DedupKey
import com.xyzwps.paimon.furina.modules.post.entity.Post
import com.xyzwps.paimon.furina.modules.post.entity.PostCollection
import com.xyzwps.paimon.furina.modules.post.entity.PostType
import jakarta.validation.constraints.NotBlank
import jakarta.validation.constraints.Size

data class PostCollectionSavePayload(
    @field:Size(max = PostCollection.TITLE_MAX_LEN, message = "标题最长不可超过${PostCollection.TITLE_MAX_LEN}个字符")
    @field:NotBlank(message = "标题不能是空白")
    val title: String,
)

data class PostCreatePayload(
    @field:Size(max = Post.TITLE_MAX_LEN, message = "标题最长不可超过${Post.TITLE_MAX_LEN}个字符")
    @field:NotBlank(message = "标题不能是空白")
    val title: String,
    val type: PostType,
    @field:Size(max = Post.CONTENT_MAX_LEN, message = "内容最长不可超过${Post.CONTENT_MAX_LEN}个字符")
    val content: String,
    val collectionId: Long,
    val dedupKey: DedupKey,
    val tagIds: List<Long>,
)

data class PostUpdatePayload(
    @field:Size(max = Post.TITLE_MAX_LEN, message = "标题最长不可超过${Post.TITLE_MAX_LEN}个字符")
    @field:NotBlank(message = "标题不能是空白")
    val title: String,
    val type: PostType,
    @field:Size(max = Post.CONTENT_MAX_LEN, message = "内容最长不可超过${Post.CONTENT_MAX_LEN}个字符")
    val content: String,
    val tagIds: List<Long>,
)